Added opensc tools and libraries
authorNikos Mavrogiannopoulos <[email protected]>
Fri, 20 Jun 2014 16:26:33 +0000 (18:26 +0200)
committerNikos Mavrogiannopoulos <[email protected]>
Fri, 20 Jun 2014 16:42:47 +0000 (18:42 +0200)
Signed-off-by: Nikos Mavrogiannopoulos <[email protected]>
libs/opensc/Makefile [new file with mode: 0644]
libs/opensc/files/opensc.module [new file with mode: 0644]

diff --git a/libs/opensc/Makefile b/libs/opensc/Makefile
new file mode 100644 (file)
index 0000000..f3a56f7
--- /dev/null
@@ -0,0 +1,72 @@
+#
+# Copyright (C) 2005-2008 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=OpenSC
+PKG_VERSION:=0.13.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/OpenSC/OpenSC/archive/
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_MD5SUM:=92ed0041be8e5c53aa48c371b090b6cd
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/OpenSC
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=tools and libraries for smart cards
+  URL:=https://github.com/OpenSC/OpenSC/wiki
+  DEPENDS+= +libpcsclite +libopenssl +pcscd
+endef
+
+define Package/OpenSC/description
+ OpenSC provides a set of libraries and utilities to work with smart cards.
+ Its main focus is on cards that support cryptographic operations, and facilitate
+ their use in security applications such as authentication, mail encryption and
+ digital signatures. OpenSC implements the PKCS11 API so applications supporting
+ this API (such as Mozilla Firefox and Thunderbird) can use it. On the card OpenSC
+ implements the PKCS15 standard and aims to be compatible with every software/card
+ that does so, too.
+endef
+
+CONFIGURE_ARGS += \
+               --disable-assert \
+               --enable-pcsc \
+               --enable-sm \
+               --disable-zlib \
+               --with-pcsc-provider=libpcsclite.so.1
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopensc.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/OpenSC/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/opensc-tool $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/pkcs15-tool $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/pkcs15-init $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopensc.so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/opensc-pkcs11.so $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsmm-local.so.* $(1)/usr/lib/
+ifeq ($(CONFIG_PACKAGE_p11-kit),)
+       $(INSTALL_DIR) $(1)/etc/p11-kit/modules/
+       $(CP) \
+               ./files/opensc.module \
+               $(1)/etc/p11-kit/modules/
+endif
+endef
+
+$(eval $(call BuildPackage,OpenSC))
diff --git a/libs/opensc/files/opensc.module b/libs/opensc/files/opensc.module
new file mode 100644 (file)
index 0000000..fd1c1d9
--- /dev/null
@@ -0,0 +1 @@
+module: opensc-pkcs11.so